package com.lg.utils.hutool.io;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileNameUtil;

import java.io.File;

public class FileNameUtilTetst {
    public static void main(String[] args) {
        File file = FileUtil.file("/opt/test.txt.222");

        // "test.txt"
        String name = FileNameUtil.mainName(file);

        // "222"
        String name2 = FileNameUtil.extName(file);

        System.out.println(name);
        System.out.println(name2);

        System.out.println(FileNameUtil.extName("/sdf/wer"));
    }
}
